﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;

namespace IRC.IRepairClouds.WebClient.BasePages
{
    public class BaseAuthPage : BasePage
    {
        public BaseAuthPage()
        {
            this.PreInit += new EventHandler(_PreInit);
        }

        void _PreInit(object sender, EventArgs e)
        {
            if (!PagesAuthorization.Authorized.IsAbsoluteUrlAllowed(Request.Url.PathAndQuery))
            {
                Auth.InsufficientPermissions();
            }
        }

        public static void AuthInvoke(Auth.AuthType authType)
        {
            Auth.Invoke(authType);
        }

        public static bool AuthCheck(AuthRequirements required)
        {
            return Auth.Check(required);
        }



    }
}